home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Brotikasten
/
BROTCD01.iso
/
geos
/
geos173.d64
/
pRINT dATES
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-08-07
|
4KB
|
169 lines
10 POKE644,128:POKE56,128:CLR:POKE53280,2:POKE53281,0:PRINT"[158]";CHR$(14)
15 PRINT"[147]":PRT=0:FL=0
20 DIMTK(128),SC(128):DIMDATE$(127)
25 N=5:FORX=1TO8:P(X)=N:N=N+32:NEXTX
30 FORX=1TO9:READN:DB$=DB$+CHR$(N):NEXTX
35 PRINT"[159][147]";TAB(15);" [146]"
40 PRINTTAB(15);" [205][193][201][206] [205][197][206][213] [146]"
45 PRINTTAB(15);" [146][158]"
50 PRINTTAB(8);"[198]1 = [207]PEN DATEBOOK FILE"
55 PRINTTAB(8);"[198]3 = [196]ISPLAY/PRINT ENTRIES"
60 PRINTTAB(8);"[198]5 = [208]RINT ENTIRE DATEBOOK"
65 PRINTTAB(8);"[198]7 = [209]UIT TO DESKTOP"
70 GETA$:IFA$=""THEN70
75 IFA$=CHR$(133)THENGOSUB100:GOTO35
80 IFA$=CHR$(134)THENGOSUB370:GOTO35
85 IFA$=CHR$(135)THENGOSUB640:GOTO35
90 IFA$=CHR$(136)THEN825
95 GOTO70
100 NUMENT=0:INPUT"[147]DRIVE";DR
105 IFDR<8ORDR>9THEN100
110 OPEN15,DR,15:PRINT#15,"I0":INPUT#15,EN$,EM$,ET$,ES$:CLOSE15
115 IFEN$="00"THEN135
120 PRINT"[147]";TAB(10);EN$,EM$:PRINTTAB(8);"HIT ANY KEY FOR MAIN MENU"
125 GETA$:IFA$=""THEN125
130 RETURN
135 PRINT"[147]";TAB(7);"SEARCHING FOR DATEBOOK FILE"
140 OPEN15,DR,15:OPEN5,DR,5,"#"
145 FORS=1TO19:PRINT#15,"U1";5;0;18;S
150 FORF=1TO8:NAME$="":PRINT#15,"B-P";5;P(F)
155 FORI=1TO9:GET#5,A$:IFA$=""THENA$=CHR$(0)
160 A=ASC(A$):IFA>127THENA=A-128
165 IFA=34THENA=63
170 NAME$=NAME$+CHR$(A):NEXT:IFNAME$=DB$THEN200
175 NEXT:NEXT
180 CLOSE2:CLOSE15:PRINT"[147]";TAB(7);"DATEBOOK FILE NOT ON DISK"
185 PRINT"CHECK DISK; HIT ANY KEY TO CONTINUE"
190 GETA$:IFA$=""THEN190
195 RETURN
200 PRINT#15,"B-P";5;P(F)-2:GET#5,T$:GET#5,S$:T=ASC(T$):S=ASC(S$)
205 PRINT#15,"U1";5;0;T;S
210 GET#5,A$:GET#5,A$:X=1
215 GET#5,A$:IFA$=""THEN240
220 IFST<>0THEN240
225 TK(X)=ASC(A$)
230 GET#5,A$:SC(X)=ASC(A$+CHR$(0))
235 X=X+1:GOTO215
240 PRINT"[147]";TAB(11);"FOUND DATEBOOK FILE"
245 PRINTTAB(11);"READING ENTRY DATES"
250 T=TK(1):S=SC(1):X=1
255 PRINT#15,"U1";5;0;T;S
260 GET#5,A$:T=ASC(A$+CHR$(0))
265 GET#5,A$:S=ASC(A$+CHR$(0))
270 GET#5,A$
275 FORI=1TO6
280 GET#5,A$:IFI=1ANDA$=""THENNUMENT=X:CLOSE5:CLOSE15:RETURN
285 IFA$=""THENA$=CHR$(0)
290 GOSUB340
295 ONIGOSUB305,315,330,335,335,335
300 NEXTI:DATE$(X)=DA$:X=X+1:GOTO275
305 A$=STR$(ASC(A$)):DA$=RIGHT$(A$,LEN(A$)-1):IFLEN(DA$)<2THENDA$="0"+DA$
310 RETURN
315 A$=STR$(ASC(A$)+1):A$=RIGHT$(A$,LEN(A$)-1)
320 IFLEN(A$)<2THENA$="0"+A$
325 DA$=A$+"/"+DA$:RETURN
330 DA$=DA$+"/"+CHR$(ASC(A$)+48):RETURN
335 DA$=DA$+CHR$(ASC(A$)+48):RETURN
340 IFST=0THENRETURN
345 PRINT#15,"U1";5;0;T;S
350 GET#5,A$:T=ASC(A$+CHR$(0))
355 GET#5,A$:S=ASC(A$+CHR$(0))
360 RETURN
365 CLOSE5:CLOSE15:RETURN
370 IFNUMENT<>0THEN405
375 PRINT"[147]";TAB(8);"[206][207] [197][206][212][210][217] [196][193][212][197][211] [201][206] [205][197][205][207][210][217]"
380 PRINT"";TAB(9);"[195]HOOSE [198]1 AT MAIN MENU"
385 PRINTTAB(9);"TO OPEN DATEBOOK FILE."
390 PRINT"";TAB(7);"[200]IT ANY KEY TO CONTINUE..."
395 GETA$:IFA$=""THEN395
400 RETURN
405 PTR=1
410 PRINT"[147]":FORX=PTRTOPTR+4
415 IFX>NUMENTTHENNEXTX:GOTO435
420 IFX+5>NUMENTTHENPRINT"";TAB(5);DATE$(X):NEXTX:GOTO435
425 PRINT"";TAB(5);DATE$(X);TAB(25);DATE$(X+10)
430 NEXTX
435 PRINT"ENTER MO/DA/YR [146] TO DISPLAY/PRINT ENTRY"
440 PRINT"ENTER MO/YR [146] TO PRINT ENTIRE MONTH"
445 PRINT"HIT RETURN [146] FOR MORE ENTRY DATES"
450 PRINT"ENTER M [146] FOR MAIN MENU":A$=""
455 INPUT"";A$
460 IFA$="M"THEN RETURN
465 IFLEN(A$)=8THENGOSUB545:GOTO410
470 IFLEN(A$)=5THENGOSUB510:GOTO410
475 IFA$<>""THEN410
480 IFX+9>NUMENTTHENGOSUB490:GOTO405
485 PTR=X+10:GOTO410
490 PRINT"[147]";TAB(13);"[206][207] [205][207][210][197] [197][206][212][210][201][197][211]"
495 PRINTTAB(8);"[200]IT ANY KEY TO CONTINUE..."
500 GETA$:IFA$=""THEN500
505 RETURN
510 N=1:FORX=1TONUMENT
515 IFLEFT$(DATE$(X),2)<>LEFT$(A$,2)THEN535
520 IFMID$(DATE$(X),9,2)<>RIGHT$(A$,2)THEN535
525 IFN=1THENBEG=X+1
530 N=X+1:PRINTDATE$(N-1)
535 NEXTX:IFN=1THENGOSUB580:RETURN
540 FINISH=N:GOSUB650:RETURN
545 N=1:FORX=1TO NUMENT
550 IFLEFT$(DATE$(X),5)<>LEFT$(A$,5)THEN570
555 IFRIGHT$(DATE$(X),2)<>RIGHT$(A$,2)THEN570
560 IFN=1THENBEG=X+1
565 N=X+1:PRINTDATE$(N-1)
570 NEXTX:IFN=1THENGOSUB580:RETURN
575 FINISH=N:GOSUB650:RETURN
580 PRINT"[147]";TAB(6);"NO ENTRIES FOR DATE ENTERED"
585 PRINTTAB(8);"HIT ANY KEY TO CONTINUE"
590 GETA$:IFA$=""THEN590
595 RETURN
600 GOSUB775
605 PRINT"[147]";TAB(15);DATE$(X-1);""
610 PRINTD$
615 PRINTTAB(13);"HIT P TO PRINT"
617 PRINTTAB(13);"HIT Q TO QUIT"
620 PRINTTAB(6);"OR ANY OTHER KEY TO CONTINUE"
625 GETA$:IFA$=""THEN625
627 IFA$="P"THENGOSUB810
630 IFA$="Q"THENRETURN
635 RETURN
640 IFNUMENT=0THENGOSUB375:RETURN
645 FL=1:BEG=2:FINISH=NUMENT:GOSUB650:FL=0:RETURN
650 PRINT"[147]";TAB(11);"[212][210][193][206][211][204][193][212][201][206][199] [193][211][195][201][201]"
655 IFFL<>1THEN670
660 PRINTTAB(14);"[193][206][196] [208][210][201][206][212][201][206][199]"
665 PRINTTAB(13);"HIT Q TO QUIT"
670 OPEN15,DR,15:OPEN5,DR,5,"#"
675 FORX=BEG TO FINISH
680 T=TK(X):S=SC(X):D$=""
685 PRINT#15,"U1";5;0;T;S
690 GET#5,A$:T=ASC(A$+CHR$(0))
695 GET#5,A$:S=ASC(A$+CHR$(0))
700 GET#5,A$:IFA$=""THEN725
705 IFASC(A$)=141THENA$=CHR$(13)
710 GOSUB750
715 IFLEN(D$)=254THEN725
720 D$=D$+A$:GOTO700
725 IFFL<>1THEN740
730 GETX$:IFX$="Q"THENCLOSE5:CLOSE15:RETURN
735 GOSUB775:GOSUB810:GOTO745
740 GOSUB600:IFA$="Q"THENCLOSE5:CLOSE15:RETURN
745 NEXTX:CLOSE5:CLOSE15:RETURN
750 IFST=0THENRETURN
755 PRINT#15,"U1";5;0;T;S
760 GET#5,A$:T=ASC(A$+CHR$(0))
765 GET#5,A$:S=ASC(A$+CHR$(0))
770 RETURN
775 L=LEN(D$):DD$="":FORCP=1TOL:CC$=MID$(D$,CP,1):CA=ASC(CC$)
780 IFCA>96ANDCA<123THEN795
785 IFCA>64ANDCA<91THEN800
790 DD$=DD$+CC$:GOTO805
795 CA=CA-32:CC$=CHR$(CA):GOTO790
800 CA=CA+32:CC$=CHR$(CA):GOTO790
805 NEXT:D$=DD$:RETURN
810 PRT=1:OPEN4,4,7:PRINT#4," ":PRINT#4,DATE$(X-1)
815 PRINT#4,D$:CLOSE4:RETURN
820 GOTO820
825 IFPRT=1THENOPEN4,4,0:PRINT#4,CHR$(12):CLOSE4
830 SYS49893:SYS49708:NEW
835 DATA68,97,116,101,32,66,111,111,107